﻿<?php
session_start();
require ('../quanju.php');
$ls_wdk = 1;
$result = $conn->query("SELECT * FROM hg002 WHERE sjh='{$_SESSION['df_sjh']}'");
if ($result) {
    if($row = mysqli_fetch_array($result)) {
        $sj = intval($row['jkmsj']);
        if($_SESSION['df_jkm'] < 0){
            $df_XXjkm = -$_SESSION['df_jkm'];
            if(!(strpos($row['jkm'],'!'.$df_XXjkm) === false) && time() - $sj <= 60 * 5){
                $ls_wdk = 0;
            }
        }else if($row['jkm'] == $_SESSION['df_jkm'] && time() - $sj <= 60 * 5){
            $ls_wdk = 0;
        }else if(!(strpos($row['jkm'],$_SESSION['df_jkm'].'!') === false) && time() - $sj <= 60 * 5){
            $ls_wdk = 0;
        }
        if($ls_wdk == 0 && $row['xingzuo'] > 0){
            $xingzuo = array('','魔羯座','水瓶座','双鱼座','白羊座','金牛座','双子座','巨蟹座','狮子座','处女座','天秤座','天蝎座','射手座');
            $ls_wdk = '2e'.$xingzuo[$row['xingzuo']];
            $result = $conn->query("UPDATE hg002 SET xingzuo=0 WHERE sjh='{$_SESSION['df_sjh']}'");
            if($result){
                
            }
        }
            
    }
}
$conn->close();
echo $ls_wdk;
exit;
?>